package com.heyun.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import com.heyun.bean.HeyunDept;
import com.heyun.dao.HeyunDeptDao;
import com.heyun.service.HeyunDeptService;
@Service
public class HeyunDeptImpl implements HeyunDeptService {
	public static void main(String[] args) {
		ApplicationContext context =new ClassPathXmlApplicationContext("config/spring-default.xml");
		HeyunDeptService hyds=(HeyunDeptService) context.getBean("heyunDeptImpl");
		System.out.println(hyds.getDept(1).getDeptName());
	}
    @Autowired
    HeyunDeptDao hydd;
	@Override
	public int insertDept(HeyunDept hyd) {
		// TODO Auto-generated method stub
		int a=hydd.insertDept(hyd);
		return a;
	}

	@Override
	public int removeDept(int deptId) {
		// TODO Auto-generated method stub
		int a=hydd.removeDept(deptId);
		return a;
	}

	@Override
	public int updateDept(HeyunDept hyd) {
		// TODO Auto-generated method stub
		int a=hydd.updateDept(hyd);
		return a;
	}

	@Override
	public HeyunDept getDept(int deptId) {
		// TODO Auto-generated method stub
		HeyunDept hd=hydd.getDept(deptId);
		return hd;
	}

	@Override
	public List<HeyunDept> listAllDept() {
		// TODO Auto-generated method stub
		List<HeyunDept>list=hydd.listAllDept();
		return list;
	}

}
